package xyz.yq56.glue_tool.toolWindow;

import org.jetbrains.annotations.NotNull;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;

import xyz.yq56.glue_tool.view.GlueToolWindow;

/**
 * @author yi qiang
 * @date 2023-11-30 21:19:39
 */
public class GlueToolWindowFactory implements ToolWindowFactory {
    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        GlueToolWindow glueToolWindow = new GlueToolWindow();
        ContentFactory instance = ContentFactory.SERVICE.getInstance();
        Content content = instance.createContent(glueToolWindow.getMainPanel(), "Setting", false);
        content.setCloseable(false);
        toolWindow.getContentManager().addContent(content);
    }
}
